{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">订单列表</li>
        </ul>
        <div class="layui-tab-content">
            <a class="layui-btn layui-btn-small" href="{:url('admin/order/exportExcel',['cid'=>$cid])}">导出数据</a>
            {if condition="$admin_id eq 1"}<button class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/order/clear_all',['cid'=>$cid])}">清空数据</button>{/if}
            <br />
            <div style="font-weight:700;">总进线：{$total}</div>
            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>用户姓名</th>
                        <th>用户手机</th>
                        <th>用户地址</th>
                        <th>用户ip</th>
                        <th>用户来源</th>
                        <th>下单时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="order_list" item="vo" key="ko"}
                    <tr>
                        <td>{$ko}</td>
                        <td>{if condition="$admin_id eq 1"}{$vo.name}{else /}******{/if}</td>
                        <td>{if condition="$admin_id eq 1"}{$vo.phone}{else /}****{$vo.phone | substr=4}{/if}</td>
                        <td>{$vo.address}</td>
                        <td>{$vo.xdip}</td>
                        <td>{$vo.xdref}</td>
                        <td>{$vo.xdtime|date="Y-m-d H:i:s",###}</td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$order_list->render()}
            </div>
        </div>
    </div>
</div>
{/block}